package com.zack.designPattern.mediator;

import java.util.ArrayList;
import java.util.List;

public class Mediator {

	private List<Colleague> colleagues;
	
	public Mediator(){
		this.colleagues = new ArrayList<Colleague>();
	}
	
	public void addColleague(Colleague c){
		this.colleagues.add(c);
	}
	
	public void winAll(Colleague winner){
		for(Colleague c : colleagues){
			if(c!=null&&c.equals(winner)){
				c.win();
			}else{
				c.loose();
			}
		}
	}
}
